home *** CD-ROM | disk | FTP | other *** search
- (define (pascal rows modulus)
- (define ystep 2)
- (define xstep 2)
- (define xshift -1)
- (define radius 1)
- (define (put-list x y l)
- (when (pair? l)
- ; (set-color (remainder (car l) modulus))
- ; (circle (cons x y) radius)
- (let ((color (remainder (car l) modulus)))
- (put-pixel (cons x y) color))
- ; (put-pixel (cons x (1+ y)) color))
- ; (put-pixel (cons (1+ x) y) color)
- ; (put-pixel (cons (1+ x) (1+ y)) color))
- (put-list (+ x xstep) y (cdr l))))
- (define (inner rows x y l)
- (put-list x y l)
- (if (> rows 0)
- (inner (- rows 1) (+ x xshift) (+ y ystep)
- (map + (cons 0 l) (append l '(0))))))
- (inner rows (quotient (car (get-max-xy)) 2) ystep '(1)))